<template>
	<view>
		<block v-if="value">
			<block v-if="styles=='map'">
				<view class="relative default-view  bg-white  live-view margin-lr-xs margin-bottom-sm" :class="[styles,'column'+col,'indexvalue'+indexvalue]"
				 @tap="goDetail">
					<view class="thumb bg-gray">
						<image :src="value.thumb" mode="aspectFill"></image>
					</view>
					<view class="mainview">
						<view class="top flex-start flex align-center ">
							<image class="round cu-avatar lecturer_thumb avatar70" :src="value.lecturer_thumb" mode="aspectFill"></image>
							<text class="default-count text-white  text-sm round">{{value.default_count}}人观看</text>
						</view>
						<view class="bottom overflow text-overflow text-white margin-tb-sm padding-lr-sm flex-end w100">{{value.title}}</view>
					</view>
				</view>
			</block>
			<block v-else-if="styles=='list'">
				<view class="margin-top margin-lr bg-white shadow-warp" :class="styles" @tap="goDetail">
					<view class="relative default-view live-view" :class="['column'+col,'indexvalue'+indexvalue]">
						<view class="thumb bg-gray">
							<image :src="value.thumb" mode="aspectFill" class="w100"></image>
						</view>
						<view class="mainview">
							<view class="top flex-start flex align-center " v-if="value.stream_status==1">
								<image class="round cu-avatar lecturer_thumb avatar70" :src="value.lecturer_thumb" mode="aspectFill"></image>
								<text class="default-count text-white  text-sm round">{{value.default_count}}人观看</text>
							</view>
							<view class="bottom overflow text-overflow text-white padding-sm flex-end w100">{{value.title}}</view>
						</view>
					</view>
					<view class="space-between padding-sm">
						<text>主讲人：{{value.lecturer_name}}</text>
						<text class="text-red" v-if="value.stream_status==1">直播中</text>
						<text class="text-gray" v-else>开播时间:{{$common.timeFormat(value.start_time)}}</text>
					</view>
				</view>
			</block>
			<block v-else-if="styles=='list2'">
				<view class="margin-top margin-lr solid-bottom padding-bottom-sm bg-white" :class="styles" @tap="goPage('/pages/shop/marketing/auction/live?id='+value.id)">
					<view class="relative default-view live-view space-between" :class="['column'+col]">
						<view class="cu-avatar bg-white thumb relative">
							<image :src="value.thumb" mode="aspectFill" class="w100"></image>
							<view class="absolute blackbg1 radius text-white text-sm padding-xs tab23">
								<text class="cuIcon cuIcon-playfill"></text>
								<text>{{value.status_txt}}</text>
							</view>
						</view>
						<view class=" margin-left w100 overflow content">
							<view class=" margin-bottom-xs text-overflow-2 title w100">{{value.name}}</view>
							<view class="text-gray">{{$common.timeFormat(value.start_time)}}</view>
							<!-- <view class="cu-btn round margin-top-xs sm" :class="'bg-'+theme"  @tap="goPage('/pages/member/live/push?id='+value.id)">去开播</view> -->

							<view class="relative">
								<view class="grid col-4 grid-square margin-top-xs">
									<view class="bg-img  margin-right-sm" v-for="(goods,pi) in value.product" v-if="pi<4" :key="pi">
										<image :src="goods.product.picture" mode="aspectFill"></image>
									</view>
								</view>
								<view class="absolute blackbg1 rt padding-sm text-white ">
									竞拍商品
								</view>
							</view>
						</view>
					</view>
				</view>
			</block>
			<block v-else-if="styles=='list3'">
				<view class="margin-top margin-lr solid-bottom padding-bottom-sm bg-white list2">
					<view class="relative default-view live-view space-between" :class="['column'+col]">
						<view class="cu-avatar bg-white thumb relative">
							<image :src="value.thumb" mode="aspectFill" class="w100"></image>
							<view class="absolute blackbg1 radius text-white text-sm padding-xs tab23">
								<text class="cuIcon cuIcon-playfill"></text>
								<text>{{value.status_txt}}</text>
							</view>
						</view>
						<view class=" margin-left w100 overflow content">
							<view class=" margin-bottom-xs text-overflow-2 title w100">{{value.name}}</view>
							<view class="text-gray">{{$common.timeFormat(value.start_time)}}</view>
							<view class="cu-btn round margin-top-sm sm" :class="'bg-'+theme"  @tap="goPage('/pages/member/live/push_auction3?id='+value.id)">去开播</view>
						</view>
					</view>
				</view>
			</block>
		</block>
	</view>
</template>

<script>
	export default {
		components: {},
		props: {
			value: {
				type: Object,
				default: null
			},
			col: {
				type: String,
				default: "1"
			},
			indexvalue: {
				type: String,
				default: "1"
			},
			styles: {
				type: String,
				default: 'map'
			}
		},
		created: function(e) {},
		data() {
			return {
				theme: this.$config.THEME(),
				// lineIndex:0,
			}
		},
		methods: {
			goGoodsDetail(id) {
				uni.navigateTo({
					url: "/pages/shop/goods?id=" + id
				})
			},
			goDetail() {
				if (this.value.type == 4) {
					uni.navigateTo({
						url: '/pages/shop/live/live?id=' + this.value.id
					})
				} else if (this.value.type == 1) {
					uni.navigateTo({
						url: '/collegePackages/pages/college/live/live?id=' + this.value.id
					})
				}
			}
		},
	}
</script>

<style>
	.live-view {
		overflow: hidden;
		border-radius: 15rpx;
	}

	.cu-avatar {
		width: 70rpx;
		height: 70rpx;
	}

	.map .mainview {
		width: 100%;
		height: 100%;
		position: absolute;
		left: 0;
		top: 0;
		background-color: rgb(0, 0, 0, 0.3);
	}

	.list .mainview {
		width: 100%;
		height: 100%;
		position: absolute;
		left: 0;
		top: 0;
	}

	.bottom {
		bottom: 0;
		position: absolute;
	}

	.list .bottom {
		background-color: rgb(0, 0, 0, 0.3);
	}

	.top {
		margin: 20rpx;
	}

	.default-count {
		padding: 10rpx 20rpx 10rpx 40rpx;
		background-color: rgb(0, 0, 0, 0.3);
		margin-left: -30rpx;
	}

	.lecturer_thumb {}

	.thumb {
		width: 100%;
		height: 100%;
	}

	.thumb image {
		width: 100%;
		height: 100%;
	}

	.indexvalue1,
	.indexvalue4 {
		height: 400upx;
	}

	.indexvalue2,
	.indexvalue3 {
		height: 300upx;
	}

	.w30 {
		width: 200rpx;
		height: 200rpx;
		min-width: 200rpx;
	}

	.avatar70 {
		width: 70rpx !important;
		height: 70rpx !important;
	}

	.list2 {
		height: 270rpx;
		overflow: hidden;
	}

	.list2 .thumb {
		width: 230rpx;
		height: 230rpx;
		min-width: 230rpx;
	}

	.list2 .title {
		height: 80rpx;
		line-height: 40rpx;
	}

	.list2 .bg-img {
		width: 80rpx;
		height: 80rpx;
	}

	.bg-img image {
		width: 100%;
		height: 100%;
	}

	.tab23 {
		left: 10rpx;
		top: 10rpx;
	}

	.rt {
		right: 0;
		top: 0;
	}
</style>
